/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.synjones.pay.serv.transfer.controller;

import com.synjones.pay.model.transfer.TransferReqBean;
import com.synjones.pay.model.transfer.TransferRespBean;
import com.synjones.pay.serv.transfer.service.ITransferService;
import javax.annotation.Resource;
import org.apache.commons.lang.builder.ReflectionToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 *
 * @author hsd
 */
@RestController
public class TransferController {
    private final static Logger logger = LoggerFactory.getLogger(TransferController.class);
    
    @Resource
    private ITransferService transferService;
    
    @RequestMapping(value = "/payment/transfer")
    public TransferRespBean transferPay(@RequestBody TransferReqBean reqBean){
        logger.info("转账信息：\r\n", ReflectionToStringBuilder.toString(reqBean, ToStringStyle.MULTI_LINE_STYLE));
        return transferService.tradeProcess(reqBean);
    }
}
